Skip to content

perlapi/perlintern: Note binary-compatibility-only entries #23332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

khwilliamson
Copy link
Contributor

Some API elements exist only so that already-existing uses of them can continue to use them without change. Generally newer/shinier methods have come along to accomplish the tasks these do, and new code should use those newer methods.

It effectively is deprecated to use these for new code.

This commit changes perlapi and perlintern to highlight such elements as not being wise to use going forward. Also, we should feel no pressure to add documention on how to use these elements. The code that already uses them probably already knows how to use them. And if it isn't using them properly, it would be advantageous to convert to use the shinier method, instead of trying to figure out how to get the old one to work.

However, this change shows that some elements are wrongly marked as being binary-compatibility only. The list of these needs to examined, and other commits made to remove that marking when appropriate. The list is contained in

http://nntp.perl.org/group/perl.perl5.porters/269936

  • This set of changes does not require a perldelta entry.

Some API elements exist only so that already-existing uses of them can
continue to use them without change.  Generally newer/shinier methods
have come along to accomplish the tasks these do, and new code should use
those newer methods.

It effectively is deprecated to use these for new code.

This commit changes perlapi and perlintern to highlight such elements as
not being wise to use going forward.  Also, we should feel no pressure
to add documention on how to use these elements.  The code that already
uses them probably already knows how to use them.  And if it isn't using
them properly, it would be advantageous to convert to use the shinier
method, instead of trying to figure out how to get the old one to work.

However, this change shows that some elements are wrongly marked as
being binary-compatibility only.  The list of these needs to examined,
and other commits made to remove that marking when appropriate.  The
list is contained in

http://nntp.perl.org/group/perl.perl5.porters/269936
@bulk88
Copy link
Contributor

bulk88 commented Jun 19, 2025

Regarding my post at https://www.nntp.perl.org/group/perl.perl5.porters/2025/05/msg269942.html and all of thread http://nntp.perl.org/group/perl.perl5.porters/269936 .

What is your/perl's definition of the word "binary-compatibility"?

Do you mean compatibility with pre-existing, long ago compiled .o/.a/.lib/.obj/.dll/.so/.pch/.ilk files, that require /bin/ld and dl_open() dl_sym() ABI compatibility with newer perl.exe/perl5XX.dll files through the ELF PLT/GOT and Win32 PE Imp/Exp Table?

Or do you really mean unmodified C source code compatibility with ancient CPAN .tar.gz files?

Add a sentence somewhere in the commit body, or somewhere in the commit's src code, clarifying what "binary-compatibility" means in this exact patch/this exact case.

The p5p/.git tech term "binary-compatibility" ever since the release of 5.10.0 been very blurry and multiple meanings.

"binary-compatibility" can mean:

  • ELF PLT GOT and /bin/ld and Win32 PE Import Export table compatibility
  • C src code compatibility, remember P5P has almost never documented what is a dl_sym() linkable symbol, and what is a static inline symbol, and what is a #define
  • offsets and sizes of C structs that are fundamental CPAN XS public API of writing Perl in C, example: NV size
  • offsets and sizes of not-public API "not for CPAN" C structs that are reachable from CPAN XS , but are labeled DANGER: at your own risk by P5P. All of the Devel::* and B::* modules on CPAN fall into this category.
  • offsets and sizes of unreachable private C structs and typedefs that exist only in a single libperl TU. This isn't a bin-compat problem, its a beginner at Perl C CORE hacking problem and they need to run git clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants